package cn.edu.scau.cmi.xiaozhenlin.adapter;

import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.scene.input.MouseEvent;

public class AdapterController {

	@FXML
	private TextArea tv_show;

	@FXML
	private Label tv_gun;

	@FXML
	private Button btn_class;

	@FXML
	private Button btn_object;

	@FXML
	private Button btn_shoot;

	private Gun gun;

	public void init() {
		gun = new Gun();
	}

	@FXML
	void classStrenth(MouseEvent event) {
		MachineGun machineGun = new AdapterOfClass();
		tv_gun.setText("类机关枪");
		tv_show.setText(machineGun.strengthen());
	}

	@FXML
	void objectStrenth(MouseEvent event) {
		MachineGun machineGun = new AdapterOfObject();
		tv_gun.setText("对象机关枪");
		tv_show.setText(machineGun.strengthen());
	}

	@FXML
	void onShoot(MouseEvent event) {
		tv_show.setText(gun.shoot());
		tv_gun.setText("手枪");
	}

}
